package com.nbsaas.boot.app.rest.convert;

import com.nbsaas.boot.app.data.entity.AppRoleMenu;
import com.nbsaas.boot.app.api.domain.simple.AppRoleMenuSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class AppRoleMenuSimpleConvert implements Converter<AppRoleMenuSimple, AppRoleMenu> {




@Override
public AppRoleMenuSimple convert(AppRoleMenu source) {
    AppRoleMenuSimple result = new AppRoleMenuSimple();

                if(source.getApp()!=null){
                    result.setApp(source.getApp().getId());
                }
                if(source.getRole()!=null){
                    result.setRole(source.getRole().getId());
                }
                if(source.getApp()!=null){
                    result.setAppName(source.getApp().getName());
                }
                result.setId(source.getId());
                if(source.getMenu()!=null){
                    result.setMenu(source.getMenu().getId());
                }


    return result;
}

}